package com.huiminpay.rocketmq.consumer.message;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "demo-consumer-group", topic ="my_topic" )
public class ConsumerSimple implements RocketMQListener<String> {

    //处理消息的方法
    @Override
    public void onMessage(String msg) {
        //  处理消息的业务逻辑
        //.....
        System.out.println(msg);
    }
}
